package com.yupi.springbootinit.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 工艺单产品明细表
 */
@TableName(value = "process_sheet_product")
@Data
public class ProcessSheetProduct implements Serializable {

    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @TableField("process_sheet_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long processSheetId;

    @TableField("order_item_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderItemId;

    @TableField("product_code")
    private String productCode;

    @TableField("product_name")
    private String productName;

    @TableField("specification")
    private String specification;

    /**
     * 订单数量（仅作参考显示）
     */
    private Integer quantity;

    /**
     * 零件图号（工程部手动输入）
     */
    @TableField("part_drawing_no")
    private String partDrawingNo;

    /**
     * 单件重量（g，工程部手动输入）
     */
    @TableField("unit_weight")
    private BigDecimal unitWeight;

    /**
     * 产品高度（mm，工程部手动输入）
     */
    @TableField("product_height")
    private BigDecimal productHeight;

    @TableField("sort_order")
    private Integer sortOrder;

    private String remark;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;

    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}